/*
	Tester class for Part4.

	This class creates some shapes, then adds them to a LinkedList2 object
		using the addLast method of the class.  The list is then sorted using the
		sort method.  The contents of the list
	are then printed to show the sort method worked.

	DO NOT MODIFY THE CODE IN THIS CLASS.

*/

public class Part4Tester
{
	private static int MAX_SHAPES = 10;

	public static void main(String [] args)
	{
		Shape [] shapes = new Shape[MAX_SHAPES];
		int i;

		shapes[0] = new Square(4);
		shapes[1] = new Circle(1);
		shapes[2] = new Square(8);
		shapes[3] = new Circle(2);
		shapes[4] = new Square(4);
		shapes[5] = new Square(4);
		shapes[6] = new Circle(1);
		shapes[7] = new Square(8);
		shapes[8] = new Circle(2);
		shapes[9] = new Square(4);


		LinkedList2 list = new LinkedList2();

		System.out.println("List contents after creation:\n----------\n" + list);

		list.sort();
		System.out.println("\n->Empty List after sorting:\n----------\n"+ list);


		list.addLast(shapes[0]);
		list.sort();
		System.out.println("\n->List after sorting with only 1 item: \n----------\n" + list);

		list.addLast(shapes[1]);
		list.sort();
		System.out.println("\n->List after sorting with 2 items: \n----------\n" + list);

		for (i = 2; i < shapes.length; i++)
			list.addLast(shapes[i]);

		System.out.println("List after adding 8 more items: \n----------\n" + list);
		list.sort();
		System.out.println("->List after sorting with the 8 new items: \n----------\n" + list);

	}//end main method

}//end class Part4Tester